package top.lilele.adminSystem.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotEmpty;
import java.io.Serializable;
import java.util.Date;

/**
 * @author lilele
 */
@Getter
@Setter
@TableName(value = "admin_role")
public class AdminRoleEntity implements Serializable {

    /**
     * id
     */
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private String id;

    /**
     * 角色名
     */
    @NotEmpty(message = "角色名称不能为空")
    @Length(message = "角色名称限制30个字符", max = 30)
    @TableField(value = "roleName")
    private String roleName;

    /**
     * 角色描述
     */
    @NotEmpty(message = "角色描述不能为空")
    @Length(message = "角色名限制描述100个字符", max = 100)
    @TableField(value = "description")
    private String description;

    /**
     * 是否是管理员 1 管理员  2 非管理员
     */
    @TableField(value = "isAdmin")
    private Integer isAdmin;

    @TableField(value = "createdTime", fill = FieldFill.INSERT)
    private Date createdTime;
    @TableField(value = "updatedTime", fill = FieldFill.UPDATE)
    private Date updatedTime;
}
